package com.learn.criminalintent

import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import java.util.Date
import java.util.UUID

@Entity
data class Crime(
    // 生成唯一ID值
    @PrimaryKey var id: UUID = UUID.randomUUID(),
    // 标题
    var title: String = "",
    // 发生时间，默认为当前时间
    var date: Date = Date(),
    // 是否解决
    var isSolved: Boolean = false,
    var suspect: String = "",
    var phone: String = ""
) {
    /**
     * 获取文件名
     */
    val photoFileName get() = "crime_$id.jpg"

    // Secondary constructor for quick creation
    @Ignore
    constructor(title: String) : this(UUID.randomUUID(), title, Date(), false)
}